package com.mc.gpm.service.impl;

import java.util.List;
import com.mc.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mc.gpm.mapper.GpmShelveMapper;
import com.mc.gpm.domain.GpmShelve;
import com.mc.gpm.service.IGpmShelveService;

/**
 * 货架Service业务层处理
 *
 * @author mc
 * @date 2021-03-18
 */
@Service
public class GpmShelveServiceImpl implements IGpmShelveService
{
    @Autowired
    private GpmShelveMapper gpmShelveMapper;

    /**
     * 查询货架
     *
     * @param id 货架ID
     * @return 货架
     */
    @Override
    public GpmShelve selectGpmShelveById(long id)
    {
        return gpmShelveMapper.selectGpmShelveById(id);
    }

    /**
     * 查询货架列表
     *
     * @param gpmShelve 货架
     * @return 货架
     */
    @Override
    public List<GpmShelve> selectGpmShelveList(GpmShelve gpmShelve)
    {
        return gpmShelveMapper.selectGpmShelveList(gpmShelve);
    }

    /**
     * 新增货架
     *
     * @param gpmShelve 货架
     * @return 结果
     */
    @Override
    public int insertGpmShelve(GpmShelve gpmShelve)
    {
        gpmShelve.setCreateTime(DateUtils.getNowDate());
        return gpmShelveMapper.insertGpmShelve(gpmShelve);
    }

    /**
     * 修改货架
     *
     * @param gpmShelve 货架
     * @return 结果
     */
    @Override
    public int updateGpmShelve(GpmShelve gpmShelve)
    {
        gpmShelve.setUpdateTime(DateUtils.getNowDate());
        return gpmShelveMapper.updateGpmShelve(gpmShelve);
    }

    /**
     * 批量删除货架
     *
     * @param ids 需要删除的货架ID
     * @return 结果
     */
    @Override
    public int deleteGpmShelveByIds(String[] ids)
    {
        return gpmShelveMapper.deleteGpmShelveByIds(ids);
    }

    /**
     * 删除货架信息
     *
     * @param id 货架ID
     * @return 结果
     */
    @Override
    public int deleteGpmShelveById(String id)
    {
        return gpmShelveMapper.deleteGpmShelveById(id);
    }

    @Override
    public Integer selectGpmShelveListByNo(GpmShelve gpmShelve) {
        return gpmShelveMapper.selectGpmShelveListByNo(gpmShelve);
    }
}